package system;

import java.io.File;

/**
 * Make path for current OS.
 * @author zem
 */
public class PathName {

    public String name;

    /**
     * @param name new name of file or folder
     * @param old old name
     *
     */
    public PathName(String old, int type) {
         //type: 0 - for file; 1- for folder;


        char[] str = old.toCharArray();
        old = "";
        for (int i = 0; i < str.length; i++) {
            if (str[i] == '/' | str[i] == '\\') {
                str[i] = File.separatorChar;
            }
            old += str[i];
        }
        if (type == 1) {
            if (str[str.length - 1] != File.separatorChar) {
                old += File.separatorChar;
            }
        }

        name = old;
    }
}
